using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace eCloudEdit
{
    public partial class TcpChannelForm : Form
    {
        private int WorkMode = 0;
        public TcpChannelForm()
        {
            InitializeComponent();
        }
        public int nWorkMode
        {
            get 
            {
                if (radioButton1.Checked)
                {
                    WorkMode = 0;
                }
                if (radioButton2.Checked)
                {
                    WorkMode = 1;
                }
                return WorkMode;
            }
            set
            {
                int n=value;
                if (n==0)
                {
                    this.radioButton1.Checked = true;
                    this.radioButton2.Checked = false;
                }
                else if (n == 1)
                    {
                        this.radioButton1.Checked = false;
                        this.radioButton2.Checked = true;
                    }
               
            }
        }
        public string channelname
        {
            get
            {
                return this.label4.Text;
            }
            set
            {
                this.label4.Text = value;
            }
        }
        public string sDevIP
        {
            get
            {
                return this.textBox1.Text;
            }
            set
            {
                this.textBox1.Text = value;
            }
        }
        public string sDevPort
        {
            get
            {
                return this.textBox2.Text;
            }
            set
            {
                this.textBox2.Text = value;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void radioButton1_Click(object sender, EventArgs e)
        {
            WorkMode = 0;
        }

        private void radioButton2_Click(object sender, EventArgs e)
        {
            WorkMode = 1;
        }
    }
}